var oLi = document.querySelectorAll(".content_body_left ul span");
var aSpan = document.querySelectorAll(".content_body_left span");
var aUl = document.querySelectorAll(".content_body_left ul");
var aImg = document.querySelectorAll(".content_body_left_img2 ");
var aLi = document.querySelectorAll('.content_body_left_list li')
// console.log(aLi)

// 循环span节点
for (var i = 0; i < aSpan.length; i++) {
  // 设置span的点击事件
  aSpan[i].onclick = function () {
    var oUl = this.nextElementSibling.nextElementSibling;
    if (getComputedStyle(oUl).height == "0px") {
      this.nextElementSibling.style.transform = "rotate(180deg)";
      oUl.style.height =
        oUl.children[0].offsetHeight * oUl.children.length + "px";
    } else {
      // 否则高度为0
      oUl.style.height = "0" + "px";
      this.nextElementSibling.style.transform = " rotate(90deg)";
    }
  };
}

// 加点击事件

for(var i=0;i<aLi.length;i++){
  aLi[4].style.backgroundColor = '#2561ef'
  aLi[i].onclick = function(){
    for (var j = 0; j < aLi.length; j++) {
      aLi[j].style.backgroundColor = "";
    }
    this.style.backgroundColor = '#2561ef'
  }
}

